/*
 * RotateTransition.java
 *
 * Created on 26 maj 2007, 21:07
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package edu.uj.petri.commands;

import edu.uj.petri.model.Transition;
import edu.uj.petri.view.TransitionView;
import java.util.ResourceBundle;

/**
 *
 * @author Paweł
 */
public class RotateTransition extends Command {
    
    private TransitionView transitionView;
    private boolean before;
    
    /** Creates a new instance of RotateTransition */
    public RotateTransition( TransitionView transitionView ) {
        
        this.transitionView = transitionView;
        before = transitionView.isVertical;
    }

    public String toString() {
        
        return ResourceBundle.getBundle("edu/uj/petri/messages").getString("obrocenie_tranzycji") + ((Transition)transitionView.getNode()).getName();
    }

    void execute() {
        
        transitionView.isVertical = !before;
    }

    void undo() {
        
        transitionView.isVertical = before;
    }

    boolean canBeCombined(Command c) {
        
        return false;
    }

    private static final long serialVersionUID = 5757019210565500415L;
}
